/**
 * Created with IntelliJ IDEA.
 * User: duoba
 * Date: 16/2/25
 * Time: 上午10:56
 * To change this template use File | Settings | File Templates.
 */

package com.cake21.uitest.Page;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import com.cake21.uitest.System.Core.Page;

public class DemoPage extends Page {
    /*页面元素*/
    @FindBy(id = "kw")
    private WebElement keyword;
    @FindBy(id = "su")
    private WebElement submit;

    /*载入页面*/
    protected void load() {
        driver.get("http://www.baidu.com");
    }

    /*获得按钮的文字*/
    public String getButtonText() {
        return submit.getAttribute("value");
    }

    /*点击搜索*/
    public void search() {
        keyword.sendKeys("软件测试");
        submit.click();
    }
}